package Demo4;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
//        Person person = new Person();
//        person.eat();
//        person.sleep();
//        person.walk();
//        System.out.println();
//
//        person = new Banker();
//        person.eat();
//        person.sleep();
//        person.walk();

        Student student1 = new Student("zhangsan",1);
        Student student2 = new Student("zhangsan",2);
        Student student3 = new Student("zhangsan",3);
        Student student4 = new Student("zhangsan",4);

        Student[] stus = {student1, student2, student3, student4};
        //只要实现了Comparable接口就可以使用sort进行比较
        Arrays.sort(stus);
        System.out.println(Arrays.toString(stus));
    }
}
